package com.xjy.headfirst.外观模式;


/**
 * decription: 外观模式我感觉是把不同的类作为共性
 *
 * @author 辛纪元
 * @since 2022-07-13
 */

public class HomeTheaterFacade {

    Amplifier amplifier;
    Tuner tuner;

    public HomeTheaterFacade(Amplifier amplifier, Tuner tuner) {
        this.amplifier = amplifier;
        this.tuner = tuner;
    }

    public void on() {
        amplifier.on();
        tuner.on();
    }

    public static void main(String[] args) {
        Amplifier amplifier = new Amplifier();
        Tuner tuner = new Tuner();
        HomeTheaterFacade homeTheaterFacade = new HomeTheaterFacade(amplifier, tuner);
        homeTheaterFacade.on();
    }

}
